#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import struct

file64 = "ff-64-8k.bin"
file128 = "ff-128-16k.bin"
file256 = "ff-256-32k.bin"
file512 = "ff-512-64k.bin"

# 8k  2**13
# 32k 2**15
# 64k 2**16
with open(file64, mode='wb+') as f:
    for i in range(2 ** 13):
        if i<16:
            s = struct.pack('B', i)
        else:
            s = struct.pack('B', 0xff)
        f.write(s)

with open(file128, mode='wb+') as f:
    for i in range(2 ** 14):
        s = struct.pack('B', 0xff)
        f.write(s)

with open(file256, mode='wb+') as f:
    count = 0
    for i in range(2 ** 15):
        if count<=0xff:
            s = struct.pack('B', count & 0xff)
            count += 1
        else:
            s = struct.pack('B', 0xff)
        f.write(s)

with open(file512, mode='wb+') as f:
    count = 0
    for i in range(2 ** 16):
        if count<=0x1ff:
            s = struct.pack('B', count & 0xff)
            count += 1
        else:
            s = struct.pack('B', 0xff)
        f.write(s)